package com.greenantmall.bean;

import com.avos.avoscloud.AVACL;
import com.avos.avoscloud.AVClassName;
import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.AVRelation;
import com.avos.avoscloud.AVRole;
import com.greenantmall.utils.iLog;

@AVClassName(AntAVObject.CLASS_HOMEPAGEITEMS)
public class RecommendByUs extends AntAVObject
{
	
	private static final String TAG="RecommendByUs";
	
	public static final String ATTR_ICON = "icon";
    public static final String ATTR_TITLE = "title";
    public static final String ATTR_LIST = "list";
    public static final String ATTR_SECTIONNUM = "sectionNum";
    public static final String ATTR_SHOWINDEX = "showIndex";


    public RecommendByUs()
    {
        super();
        setAccessCtrl();
    }

    public RecommendByUs(String str)
    {
        super(str);
        setAccessCtrl();
    }
    
    public String getIconUrl()
    {
    	try {
			return this.getAVFile(ATTR_ICON).getUrl();
		} catch (Exception e) {
		iLog.e(TAG, "getIconUrl is null");
		}
		return null;
    }
    
    public void setIconUrl(String tag)
	{
		this.put(ATTR_ICON, tag);
	}

    public String getTitle()
    {
        return this.getString(ATTR_TITLE);
    }

    public void setTitle(int tag)
    {
        this.put(ATTR_TITLE, tag);
    }

    public int getSectionNum()
    {
        return this.getInt(ATTR_SECTIONNUM);
    }

    public int getShowIndex()
    {
        return this.getInt(ATTR_SHOWINDEX);
    }

    public AVRelation<AVObject> getList()
    {
        return this.getRelation(ATTR_LIST);
    }

    public void setList(AVRelation<AVObject> tag)
    {
        this.put(ATTR_LIST, tag);
    }

    public RecommendByUs getInstance()
    {
        return this;
    }


    private int setAccessCtrl()
    {

        acl = new AVACL();
        acl.setPublicReadAccess(true);//�˴����õ��������˵Ŀɶ�Ȩ��

        return 0;
    }

}
